<?php

class Knihovna_Model_DbTable_Usersresources extends Zend_Db_Table_Abstract
{
    /** @var string */
    protected $_name = 'usersresources';
    /** @var string */
    protected $_primary = 'nazev';

    /**
     * Vrátí upravené pole se zdrojem
     *
     * @author Petr Laslo
     * @param mixed $where
     * @return array $role
     */
    public function getResource($where)
    {
        $resourceslist = $this->fetchRow($where);
        $resource = array(
            'resource' => $resourceslist['nazev'],
            'parent' => $resourceslist['rodic']
        );
        return $resource;
    }
    /**
     * Výseldek vrátí v poly
     *
     * @author Petr Laslo
     * @param mixed $where
     * @return array $roles
     */
    public function fetchArray($where = null)
    {
        $resources = array(""=>"");
        foreach($this->fetchAll($where) as $val)
        {
            $resources[$val['nazev']] = $val['nazev'];
        }
        return $resources;
    }

}

